const CreateSingleV1 = function (fn) {
  let _instance = null;
  return function () {
    return _instance || (_instance = fn.apply(this, arguments));
  };
};

const Single = (name) => {
  this.name = name;
};

const createSingle = (function () {
  let instance = null;

  return function () {
    if (instance) return instance;
    instance = new SingleTone();
    return instance;
  };
})();

const createModal = function (message) {
  const box = document.createElement("div");
  box.innerHTML = message;
  box.className = "box";
  document.appendChild(box);
  return box;
};

const createModalInstance = CreateSingleV1(createModal);

xxx.onclick = function (params) {
  const alertMessage = createModalInstance(params);
};
